{extend name="layout/base" /} {block name="main"}
<div class="row-content am-cf">{extend name="layout/base" /} {block name="main"}
    <article class="main__content content">
        <form action="save" method="post">
            <div class="content__wrapper form">
                <div class="form__group">
                    <div class="form__label">
                        用户名 :
                    </div>
                    <input name="username" value="{$user.username ?? ''}" type="text" placeholder="请输入用户名" class="textfield" />
                </div>
                <div class="form__group">
                    <div class="form__label">
                        密码 :
                    </div>
                    <input name="password" value="" type="text" placeholder="请输入密码"
                           class="textfield" />
                </div>
                <div class="form__group">
                    <input name="id" value="{$user.id ?? ''}" type="hidden">
                    <button type="submit" style="margin: 4% 40%" class="button button--radius button--blue am-margin-0">
                        <i class="fa fa-send"></i> &nbsp; 提交
                    </button>
                </div>
            </div>
        </form>
    </article>

    <script>
        $(function() {
            $('.image-editor').cropit({
                imageState: {
                    src: '{$room.image ?: ""}',
                },
            });

            $('form').submit(function() {
                // Move cropped image data to hidden input
                var imageData = $('.image-editor').cropit('export');
                $('.hidden-image-data').val(imageData);
                return true;
            });
        });
    </script>
{/block}